from sqlalchemy import Column, Integer, String, Date, Float
from database import Base

'''
    02 models 负责构建跟数据库表对应的类（ORM类）
'''
class Emp(Base):
    __tablename__ = 'emp'

    empno = Column(Integer, primary_key=True, comment="员工编号")
    ename = Column(String(20), nullable=False, comment="员工姓名")
    job = Column(String(20), nullable=False, comment="工种")
    mgr = Column(Integer, nullable=True, comment="上级领导编号")
    hiredate = Column(Date, nullable=False, comment="入职日期")
    sal = Column(Integer, nullable=False, comment="工资")
    comm = Column(Float, nullable=True, comment="奖金")
    deptno = Column(Integer, nullable=True, comment="部门编号")

